package com.jobpass.common.service.impl;


import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.jobpass.common.insterface.RoleMapper;
import com.jobpass.common.model.Role;
import com.jobpass.common.service.RoleService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author JobPass
 * @since 2020-07-17
 */
@Service
public class RoleServiceImpl extends ServiceImpl<RoleMapper, Role> implements RoleService {

    @Resource
    private RoleMapper roleMapper;
    @Override
    public List<Role> FindAllRole() {
        return roleMapper.selectList(null);
    }

    @Override
    public Role FindRoleById(Long id) {
        return roleMapper.selectById(id);
    }

    @Override
    public int DeleteRoleById(Long id) {
        return roleMapper.deleteById(id);
    }

    @Override
    public int UpdateRoleById(Role role) {
        return roleMapper.updateById(role);
    }

    @Override
    public int SavaRole(Role role) {
        return roleMapper.insert(role);
    }
}
